<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditMachineTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditMachineLabel_nom}" for="nom" />
                    <h:inputText id="nom" value="#{machineController.selected.nom}" title="#{bundle.EditMachineTitle_nom}" />
                    <h:outputLabel value="#{bundle.EditMachineLabel_fabricant}" for="fabricant" />
                    <h:inputText id="fabricant" value="#{machineController.selected.fabricant}" title="#{bundle.EditMachineTitle_fabricant}" />
                    <h:outputLabel value="#{bundle.EditMachineLabel_ref}" for="ref" />
                    <h:inputText id="ref" value="#{machineController.selected.ref}" title="#{bundle.EditMachineTitle_ref}" />
                    <h:outputLabel value="#{bundle.EditMachineLabel_dateDAchat}" for="dateDAchat" />
                    <h:inputText id="dateDAchat" value="#{machineController.selected.dateDAchat}" title="#{bundle.EditMachineTitle_dateDAchat}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditMachineLabel_designation}" for="designation" />
                    <h:inputText id="designation" value="#{machineController.selected.designation}" title="#{bundle.EditMachineTitle_designation}" />
                    <h:outputLabel value="#{bundle.EditMachineLabel_commentaireEmploye}" for="commentaireEmploye" />
                    <h:inputText id="commentaireEmploye" value="#{machineController.selected.commentaireEmploye}" title="#{bundle.EditMachineTitle_commentaireEmploye}" />
                    <h:outputLabel value="#{bundle.EditMachineLabel_idMachine}" for="idMachine" />
                    <h:inputText id="idMachine" value="#{machineController.selected.idMachine}" title="#{bundle.EditMachineTitle_idMachine}" required="true" requiredMessage="#{bundle.EditMachineRequiredMessage_idMachine}"/>
                    <h:outputLabel value="#{bundle.EditMachineLabel_idAtelier}" for="idAtelier" />
                    <h:selectOneMenu id="idAtelier" value="#{machineController.selected.idAtelier}" title="#{bundle.EditMachineTitle_idAtelier}" >
                        <f:selectItems value="#{atelierController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{machineController.update}" value="#{bundle.EditMachineSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditMachineViewLink}"/>
                <br />
                <h:commandLink action="#{machineController.prepareList}" value="#{bundle.EditMachineShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditMachineIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
